﻿<Window x:Class="AdamDsk.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:AdamDsk"
        mc:Ignorable="d"
        Title="ADAMDsk - by Payton Byrd" Height="423" Width="1013">
    <Window.Resources>
        <Style x:Key="ActionButton" TargetType="Button">
            <Setter Property="Background" Value="DimGray"/>
            <Setter Property="BorderBrush" Value="White" />
            <Setter Property="BorderThickness" Value="3" />
            <Setter Property="Foreground" Value="Yellow" />
            <Setter Property="FontSize" Value="18" />
            <Setter Property="FontWeight" Value="Bold" />
            <Setter Property="Margin" Value="2,4,2,4" />
            <Setter Property="Padding" Value="7" />
        </Style>
        <Style x:Key="SortBorderStyle" TargetType="Border">
            <Setter Property="Background" Value="Gray" />
            <Setter Property="CornerRadius" Value="0" />
            <Setter Property="BorderBrush" Value="White" />
            <Setter Property="BorderThickness" Value="3" />
            <Setter Property="Margin" Value="0,4,0,4" />
        </Style>
        <Style x:Key="SortStyle" TargetType="TextBlock">
            <Setter Property="Margin" Value="4" />
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="FontSize" Value="15" />
            <Setter Property="FontWeight" Value="Bold" />
            <Setter Property="Foreground" Value="Yellow" />
        </Style>
        <Style x:Key="FileNameTextBlock" TargetType="TextBlock">
            <Setter Property="HorizontalAlignment" Value="Stretch" />
            <Setter Property="FontSize" Value="18"/>
            <Setter Property="FontWeight" Value="ExtraBold" />
            <Setter Property="Foreground" Value="GreenYellow"/>
            <Setter Property="Margin" Value="6,0,5,0" />
        </Style>
        <Style x:Key="FileSizeTextBlock" TargetType="TextBlock">
            <Setter Property="HorizontalAlignment" Value="Left" />
            <Setter Property="FontSize" Value="12"/>
            <Setter Property="FontWeight" Value="Normal" />
            <Setter Property="Foreground" Value="AliceBlue"/>
            <Setter Property="Margin" Value="5,0,5,0" />
            <Setter Property="Width" Value="100"/>
        </Style>
        <Style x:Key="ModifiedOnTextBlock" TargetType="TextBlock">
            <Setter Property="HorizontalAlignment" Value="Left" />
            <Setter Property="FontSize" Value="12"/>
            <Setter Property="FontWeight" Value="Normal" />
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="Margin" Value="5,0,0,0" />
            <Setter Property="Width" Value="150"/>
        </Style>
        <DataTemplate x:Key="LocalFileTemplate">
            <Border x:Name="myBack" CornerRadius="0" BorderThickness="0" Padding="3">
                <TextBlock Foreground="White" HorizontalAlignment="Left" FontFamily="Lucida Console" Text="{Binding}" />
            </Border>
        </DataTemplate>
        <DataTemplate x:Key="FileTemplate">
            <Border x:Name="myBack" CornerRadius="0" BorderThickness="0" Padding="3">
                <TextBlock Foreground="White" Text="{Binding}" HorizontalAlignment="Left" FontFamily="Lucida Console"/>
            </Border>
        </DataTemplate>
        <Style x:Key="SimpleListViewItemStyle" TargetType="ListViewItem">
            <Setter Property="HorizontalAlignment" Value="Stretch" />
            <Setter Property="Background" Value="DimGray"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ListViewItem">
                        <Border BorderBrush="DimGray" x:Name="myback"
                                CornerRadius="0"
                            BorderThickness="3" 
                            Background="DimGray" 
                            Margin="4">

                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="SelectionStates">
                                    <VisualState x:Name="Selected">
                                        <Storyboard>
                                            <ColorAnimation Duration="0" Storyboard.TargetName="myback" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" To="DarkGray"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Unselected">
                                        <Storyboard>
                                            <ColorAnimation Duration="0" Storyboard.TargetName="myback" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" To="DimGray"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>

                            <Grid x:Name="Container">
                                <ContentPresenter x:Name="contentPresenter" 
                                              ContentTemplate="{TemplateBinding ContentTemplate}" 
                                              Content="{TemplateBinding Content}" 
                                              HorizontalAlignment="Stretch" 
                                              Margin="0" 
                                              VerticalAlignment="Center" />
                            </Grid>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Border Grid.Column="0" Grid.Row="0" Margin="0, 0, 3, 0" Background="DarkGray" BorderBrush="DimGray" BorderThickness="3">
            <Grid >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <TextBlock Name="txtImageName" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="18"/>
                <Button Name="btnFind" Content=" ... " Click="btnFind_Click" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" Style="{StaticResource ActionButton}" />
            </Grid>
        </Border>
        <Border Grid.Column="1" Grid.Row="0" Margin="3, 0, 0, 0" Background="DarkGray" BorderBrush="DimGray" BorderThickness="3">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Button Name="btnUpDirectory" Grid.Row="0" Grid.Column="0" Content="Up" Click="btnUpDirectory_Click" Style="{StaticResource ActionButton}"/>
                <TextBlock Name="txtDirectoryName" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="18" />
                <Button Name="btnOpenDirectory" Content=" ... " Click="btnFindFolder_Click" Grid.Row="0" Grid.Column="2" Style="{StaticResource ActionButton}" />
            </Grid>
        </Border>
        <Border Name="borderAdam" Grid.Column="0" Grid.Row="1" BorderBrush="White" BorderThickness="3" CornerRadius="0" Background="DarkGray">
            <ListView 
                Background="Transparent"
                ItemContainerStyle="{StaticResource SimpleListViewItemStyle}"
                ItemsSource="{Binding}" 
                Name="adamFiles"
                Margin="0,10,0,10"
                SelectionChanged="files_SelectionChanged"
                ItemTemplate="{StaticResource FileTemplate}"
                VerticalAlignment="Stretch" HorizontalAlignment="Stretch" SelectionMode="Extended" MouseDown="adamFiles_MouseDown"/>
        </Border>
        <Border Name="borderLocal" Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" BorderBrush="White" BorderThickness="3" CornerRadius="0" Background="DarkGray">
            <ListView 
                Background="Transparent"
                ItemContainerStyle="{StaticResource SimpleListViewItemStyle}"
                ItemsSource="{Binding}" 
                Name="files"
                Margin="0,10,0,10"
                SelectionChanged="localfiles_SelectionChanged"
                ItemTemplate="{StaticResource LocalFileTemplate}"
                VerticalAlignment="Stretch" HorizontalAlignment="Stretch" SelectionMode="Extended" MouseDoubleClick="files_MouseDoubleClick" MouseDown="files_MouseDown"/>
        </Border>
        <Border Grid.Column="0" Grid.Row="2" Margin="0, 0, 3, 0" Background="DarkGray" BorderBrush="DimGray" BorderThickness="3">
            <Grid >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" FontSize="18" Text="BLOCKS LEFT: "/>
                <TextBlock Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" FontSize="18" Name="lblBlocksLeft"/>
            </Grid>
        </Border>
        <Grid Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="3">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Button Name="F1" Style="{StaticResource ActionButton}" Grid.Column="1" Click="F1_Tapped">Help</Button>
            <Button Name="F2" Style="{StaticResource ActionButton}" Grid.Column="2" Click="F2_Tapped">Quit</Button>
            <Button Name="F4" Style="{StaticResource ActionButton}" Grid.Column="3" Click="F4_Tapped">Refresh Panel</Button>
            <Button Name="F5" Style="{StaticResource ActionButton}" Grid.Column="4" Click="F5_Tapped">Copy Item(s)</Button>
            <Button Name="F8" Style="{StaticResource ActionButton}" Grid.Column="5" Click="F8_Tapped">Delete Item(s)</Button>
            <Button Name="F10" Style="{StaticResource ActionButton}" Grid.Column="6" Click="F8_OnTapped">Rename Item</Button>
            <Button Name="F11" Style="{StaticResource ActionButton}" Grid.Column="7" Click="F10_Tapped">New Image</Button>
        </Grid>

    </Grid>
</Window>
